cmake_minimum_required(VERSION 3.8)
project(mult_lidar)

include_directories(
  include
  ${Boost_INCLUDE_DIRS}
  ${PCL_LIBRARY_DIRS}
  ${EIGEN3_INCLUDE_DIR}
)
# 查找依赖
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Sophus REQUIRED)
find_package(Ceres REQUIRED)
# 添加可执行文件
add_executable(mult_lidar src/sub_mult_lidar.cpp src/split_cloud.cpp)

# 链接库
ament_target_dependencies(mult_lidar
  rclcpp
  sensor_msgs
  pcl_conversions
  tf2
  tf2_ros
)

target_link_libraries(mult_lidar 
    Eigen3::Eigen 
    Sophus::Sophus 
    ceres 
      ${PCL_LIBRARIES}
      )

# 安装规则
install(TARGETS
  mult_lidar
  DESTINATION lib/${PROJECT_NAME}
)

# 导出包
ament_package()